#ifndef FILESTREAM_H
#define FILESTREAM_H

#include "stream.h"

namespace Library
{

class PLIBEXP FileStream : public Stream
{
	public:
						FileStream();
		virtual			~FileStream();

		// Stream overrides.
		virtual int32	read(void * buffer, int32 length);
		virtual int32	write(void * buffer, int32 length);
		virtual int32	seek(int32 offset, SeekFrom from);
		virtual int32	tell();

		// File stream originals.
		enum OpenMode	{ reading		= 0x01,
						  writing		= 0x02,
						  appending		= 0x04,
						  readwrite		= (reading | writing),
						  readappend	= (reading | appending),
						  writeappend	= (writing | appending) };

		virtual bool8	open(const String & filename, OpenMode mode);
		virtual bool8	close();

	private:
		HANDLE			m_fileHandle;
		uint32			m_mode;

	// prohibited
	private:
		FileStream(Stream &);
		FileStream & operator=(Stream &);
};

//----------------------------------------------------------------------------
// Documentation, prohibited methods (unimplemented)
//

/**
 * @fn FileStream::FileStream(Stream &)
 *
 * This method is reserved and unimplemented.  It has been defined for
 * Orthodox Canonical Form (OCF) compliance to prevent shallow object copies
 * from inadvertent use.
 */

/**
 * @fn FileStream & FileStream::operator=(Stream &)
 *
 * This method is reserved and unimplemented.  It has been defined for
 * Orthodox Canonical Form (OCF) compliance to prevent shallow object copies
 * from inadvertent use.
 */

}; // namespace Library

#endif
